<?php
$sponsor_id = (int)$this->sponsor_id;
if ($sponsor_id > 0) {

$allCategory = $this->allCategory;
$sponsor = $allCategory[$sponsor_id];

@$children = $sponsor['children'];
?>
<div class="clientLogos">
    <div id="slider_header" class="company">
        <!--a href="http://www.adaptiveplanning.com/customers/customers-overview/" class="more">MORE</a-->
        <h3><?php echo $sponsor['admin_title']?></h3>

    </div>
<div id='co_slide_box'>
<?php
if(count($children) > 0) {
    $count = 0;
    $first_time = true;
    $num_sponsor_per_slide = 6;
    foreach ($children as $key => $value):
        $child = $allCategory[$value];
        
        $path = pathinfo($child['main_image'], PATHINFO_DIRNAME);
        $fileName = pathinfo($child['main_image'], PATHINFO_BASENAME);
        if (($count%$num_sponsor_per_slide == 0) && !$first_time){
        ?>
            <div class='clear'></div>
        </div> <!-- close div class="co-slide-box"-->
        <?php
        }
        if ($count++ % $num_sponsor_per_slide == 0) {
        ?>
        <div class="co-slider-box">
        <?php
        }
?>
            <div class="co-slide">
                <img src="<?=ImageUtil::getImage($path, $fileName, 150, 70, 100, false)?>" alt="<?php echo htmlspecialchars($child['admin_title'])?>" class="company" />
            </div><!-- end slide -->

<?php
        $first_time = false;
    endforeach;
} // if children

?>
        <!-- close after for -->
            <div class='clear'></div>
        </div>
        <!-- end close after for -->
    </div> <!-- close tag div id='co_slide_box' -->
<div class="clearer"></div>
</div>

<div class="clearer"></div>

<script type="text/javascript" charset="utf-8">

    $(document).ready(function(){
		$('#co_slide_box').cycle({
		    fx: 'scrollHorz',
			slideExpr: 'div.co-slider-box',
            timeout:  10000,
			pause: true,
			speed: 1500,
            cleartypeNoBg: false
		});
		//_________ end slider _________\\
    });
</script>
<?php
} // ì sponsor
?>